<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script type="text/javascript" src="js/jquery-3.5.1.js"></script>
    <title>Document</title>

</head>

<body>
    水果id：<input id="fruitID" type="text" name="fruitID"><br>
    <button id="delBtn">删除水果信息</button>

    <script type="text/javascript">
        $("#delBtn").click(function () {
            $.ajax({
                type: 'delete',
                url: 'http://localhost:3000/fruits/' + $("#fruitID").val(),
                success: function (data) {
                    alert("删除成功")
                },
                error: (function () {
                    alert("del error")
                })
            })
        })
    </script>
</body>

</html>